package cn.qihua.action;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

/**
 * @author 米修
 * 
 */
public class LogoutAction extends ActionSupport {


	/**
	 * 
	 */
	private static final long serialVersionUID = 5179449160589501064L;

	/**
	 * 注销
	 */
	@Override
	public String execute() throws Exception {
		// PrintWriter out = response.getWriter();
		Subject subject = SecurityUtils.getSubject();
		System.out.println(subject.getPrincipal()+"已注销");
		subject.logout();
		//ActionContext.getContext().getSession().clear();
		// out.print("<script>alert('已安全退出系统，欢迎再次使用！')</script>");
		return SUCCESS;
	}
}
